﻿<div class="header" id="divTop" v-cloak>
    <div class="headerM">
        @if (User.Identity.IsAuthenticated)
        {
            if (ViewBag.index != 1)
            {
                <a class="logo1" href="/home/index">
                    <img src="~/images/account/logo.png" />
                </a>
            }
            else
            {
                <a href="/home/index" class="logo">
                    <img src="~/images/account/logo.png" />
                </a>
            }
            <div class="userBox">
                <dl class="userImg">
                    <dt>
                        <img src="/images/custom/header.png" style="width:40px;height:40px;" />
                    </dt>
                    <dd>@User.Identity.Name</dd>
                </dl>
                <ul class="setList">
                    @if (ViewBag.index == 1)
                    {
                        if (User.IsInRole(UserRoleName.Staff))
                        {
                            <li><a href="/student/apply">进入平台</a></li>
                        }
                        if (User.IsInRole(UserRoleName.CompanyAdmin))
                        {
                            <li><a href="/student/index">进入平台</a></li>
                        }
                        if (User.IsInRole(UserRoleName.Admin))
                        {
                            <li><a href="/notice/index">进入平台</a></li>
                        }

                    }

                    <li><a href="javascript:void(0)" v-on:click="showPwd">修改密码</a></li>
                    <li><a href="javascript:void(0)" v-on:click="logoff">退出</a></li>
                </ul>
            </div>
            if (ViewBag.index != 1)
            {
                <nav>
                    @if (User.IsInRole(UserRoleName.Company))
                    {
                        <a v-bind:class="{'on':navOn==1}" href="/student/apply">补录申请</a>
                        <a v-bind:class="{'on':navOn==2}" href="/student/index">学籍列表</a>
                    }
                    @if (User.IsInRole(UserRoleName.CompanyAdmin))
                    {
                        <a v-bind:class="{'on':navOn==3}" href="/SupplementSetting/index">补录设置</a>
                        <a v-bind:class="{'on':navOn==4}" href="/user/index">用户管理</a>
                    }
                    @if (User.IsInRole(UserRoleName.Manager))
                    {
                        <a v-bind:class="{'on':navOn==5}" href="/notice/index">信息发布</a>
                    }
                    @if (User.IsInRole(UserRoleName.Admin))
                    {
                        <a v-bind:class="{'on':navOn==6}" href="/Company/Index">公司开户</a>
                        @*<a v-bind:class="{'on':navOn==7}" href="/syssetting/index">系统设置</a>*@
                    }
                </nav>
            }
        }
        else
        {
            <a href="/home/index" class="logo">
                <img src="~/images/account/logo.png" />
            </a>
            <div class="userBox">
                <dl class="userImg">
                    <dd><a href="javascript:void(0)" v-on:click="showLogin">登录</a></dd>
                </dl>
            </div>
        }
        <div class="clear"></div>
    </div>
    @if (User.Identity.IsAuthenticated)
    {
        <!-- 弹出层内容 -->
        <el-dialog title="修改密码" v-bind:visible.sync="pwd.showDialog" width="600px" v-bind:close-on-click-modal="false" append-to-body>
            <el-form v-bind:model="pwd.form" v-bind:rules="rules" ref="pwd.form" label-width="80px" class="demo-ruleForm" size="small">
                <ul class="formList">
                    <li class="long">
                        <el-form-item label="旧密码" prop="pwd">
                            <el-input type="password" style="width:100%;" v-model="pwd.form.pwd" show-password placeholder="请输入旧密码" autocomplete="off"></el-input>
                        </el-form-item>
                    </li>
                    <li class="long">
                        <el-form-item label="新密码" prop="newPwd">
                            <el-input type="password" style="width:100%;" v-model="pwd.form.newPwd" show-password placeholder="请输入新密码" autocomplete="off"></el-input>
                        </el-form-item>
                    </li>
                    <li class="long">
                        <el-form-item label="确认密码" prop="newPwd2">
                            <el-input type="password" style="width:100%;" v-model="pwd.form.newPwd2" show-password placeholder="请输入确认密码" autocomplete="off"></el-input>
                        </el-form-item>
                    </li>
                </ul>
            </el-form>
            <div class="clear"></div>
            <div slot="footer" class="dialog-footer">
                <el-button v-on:click="pwd.showDialog = false">取 消</el-button>
                <el-button type="primary" v-on:click="SavePwd('pwd.form')">确 定</el-button>
            </div>
        </el-dialog>
    }
    else
    {
        <el-dialog title="用户登录" v-bind:visible.sync="login.show" width="600px" v-bind:close-on-click-modal="false" append-to-body>
            <el-form v-bind:model="login.form" v-bind:rules="rules" ref="login.form" label-width="80px" class="demo-ruleForm" size="small">
                <ul class="formList">
                    <li class="long">
                        <el-form-item label="账号" prop="lgnName">
                            <el-input style="width:100%;" v-model="login.form.lgnName" maxlength="11" placeholder="请输入账号" autocomplete="off"></el-input>
                        </el-form-item>
                    </li>
                    <li class="long">
                        <el-form-item label="密码" prop="lgnPwd">
                            <el-input type="password" style="width:100%;" v-model="login.form.lgnPwd" show-password placeholder="请输入密码" autocomplete="off"></el-input>
                        </el-form-item>
                    </li>
                    <li class="long">
                        <el-form-item label="校验码" prop="code">
                            <el-input style="width:80%;" v-model="login.form.code" placeholder="请输入校验码" autocomplete="off"></el-input>
                            <img style="display:inline-block; vertical-align:bottom;" v-bind:src="login.imgCodeUrl" v-on:click="getImgCode" />
                        </el-form-item>
                    </li>
                </ul>

            </el-form>
            <div class="clear"></div>
            <div slot="footer" class="dialog-footer">
                <el-button v-on:click="login.show = false">取 消</el-button>
                <el-button type="primary" v-on:click="loginUser('login.form')">登 录</el-button>
            </div>
        </el-dialog>
    }
</div>
